#!/usr/bin/env python
# -*- coding:utf-8 -*-

# file:06操作sqlite3修改数据.py
# author: 马国鑫
# datetime:2022/4/17 21:37
# software: PyCharm

"""
this is function  description 
"""

# import module your need

import sqlite3

conn = sqlite3.connect(r'D:\Python_code\python_web_study\db\demo.db')
cur = conn.cursor()

try:
    sql = 'delete from t_person where pno=?'
    cur.execute(sql, (1,))
    # 提交事务
    conn.commit()
    print('删除成功')
except Exception as e:
    print(e)
    print('删除失败')
    conn.rollback()
finally:
    cur.close()
    conn.close()

